package emp.dao;

import emp.config.DataSourceConfig;
import emp.entity.Department;
import emp.entity.Education;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

/**
 * @author 叶枫
 * @date 2024/12/18.
 */


public class EducationDao {
    private static DataSourceConfig dataSourceConfig;

    private JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSourceConfig.dataSource());

    //查询所有部门
    public List<Education> list()
    {
        String sql = "select * from education";
        return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Education.class));
    }
}

